package org.javaboy.demo;

import io.rebloom.client.Client;
import redis.clients.jedis.JedisPool;

public class BloomFilterDemo {
    public static void main(String[] args) {
        JedisPool jedisPool = new JedisPool("centos.javaboy.org", 6379, null, "123");
        Client client = new Client(jedisPool);
        for (int i = 0; i < 1000; i++) {
            client.add("my_filter", "user" + i);
        }
        System.out.println("client.exists(\"my_filter\", \"user10\") = " + client.exists("my_filter", "user10"));
        System.out.println("client.exists(\"my_filter\", \"user9999\") = " + client.exists("my_filter", "user9999"));
    }
}
